import request from '@/utils/request';

//生命线工程易损性分析主页面
//分页查询
export function getValEngineering(query) {
  return request({
    url: '/valEngineering/page',
    method: 'get',
    params: query
  })
}
// 查询页面的重新计算
export function reCovercalculate(query) {
  return request({
    url: '/valEngineering/recalculate',
    method: 'get',
    params: query
  })
}
// 详情
export function getByIdAndType(query) {
  return request({
    url: '/valEngineering/getByIdAndType',
    method: 'get',
    params: query
  })
}
// 查询版本
export function getVersionByType(query) {
  return request({
    url: '/valEngineering/getVersionByType',
    method: 'get',
    params: query
  })
}
// 网管验证
export function recalculate(query) {
  return request({
    url: '/upNetwork/getDataValidation',
    method: 'get',
    params: query
  })
}
// 焊接计算并保存
export function somputationSave(query) {
  return request({
    url: '/upNetwork/countContinuousWelding',
    method: 'get',
    params: query
  })
}
// 简单
export function somputationSave1(query) {
  return request({
    url: '/upNetwork/countPseVulnerability',
    method: 'get',
    params: query
  })
}
// 接口
export function somputationSave2(query) {
  return request({
    url: '/upNetwork/countInterfaceWelding',
    method: 'get',
    params: query
  })
}
//修改
export function updateValEngineering(data) {
  return request({
    url: '/valEngineering/updateValEngineering',
    method: 'post',
    data: data
  })
}
//修改回显
export function queryValEngineering(query) {
  return request({
    url: '/valEngineering/queryValEngineering',
    method: 'get',
    params: query
  })
}
//删除
export function deleteValEngineering(data) {
  return request({
    url: '/valEngineering/deleteByTypeAndId',
    method: 'post',
    data: data
  })
}

//供水
// 供水设施易损性验证
export function recalculateWsf(query) {
  return request({
    url: '/wsfManage/getDataValidation',
    method: 'get',
    params: query
  })
}
//供水设施易损性计算结果保存
export function saveWsfResult(query) {
  return request({
    url: '/wsfManage/calculationDamageDegree',
    method: 'get',
    params: query
  })
}
//供水设施易损性提交
export function saveWsfManageResult(data) {
  return request({
    url: '/valEngineering/updateByIdAndType',
    method: 'post',
    data: data
  })
}
//计算水池壁裂缝宽度并比对破坏程度
export function calculationDamageDegree(data) {
  return request({
    url: '/wsfManage/count',
    method: 'post',
    data: data
  })
}
//参数导入
export const importDamageDegreeUrl = '/wsfManage/importDamageDegree';
export function importDamageDegreeApi(data) {
  return request({
    url: importDamageDegreeUrl,
    method: 'post',
    data: data
  })
}

//供气
// 供气设施易损性验证
export function recalculateSg(query) {
  return request({
    url: '/sgManagement/getDataValidation',
    method: 'get',
    params: query
  })
}
//供气设施易损性计算结果保存
export function saveSgResult(query) {
  return request({
    url: '/sgManagement/calculation',
    method: 'get',
    params: query
  })
}
//供气设施易损性计算结果保存
export function saveSgManagementResult(data) {
  return request({
    url: '/valEngineering/updateByIdAndType',
    method: 'post',
    data: data
  })
}
//计算，导轨发生塑性弯曲时所能承受的剪力为 F1
export function calculationCrsForce(data) {
  return request({
    url: '/sgManagement/count',
    method: 'post',
    data: data
  })
}
//参数导入
export const importCsfBearingUrl = '/sgManagement/importCsfBearing';
export function importCsfBearingApi(data) {
  return request({
    url: importCsfBearingUrl,
    method: 'post',
    data: data
  })
}

//桥梁
// 桥梁易损性验证
export function recalculateCb(query) {
  return request({
    url: '/cbVulnerability/getDataValidation',
    method: 'get',
    params: query
  })
}
//桥梁易损性计算结果保存
export function saveCbResult(query) {
  return request({
    url: '/cbVulnerability/cobVulnerability',
    method: 'get',
    params: query
  })
}
//桥梁易损性计算
export function cobVulnerability(data) {
  return request({
    url: '/cbVulnerability/count',
    method: 'post',
    data: data
  })
}
//桥梁易损性保存
export function saveVulnerability(data) {
  return request({
    url: '/valEngineering/updateByIdAndType',
    method: 'post',
    data: data
  })
}

//道路
// 道路设施易损性验证
export function recalculateCar(query) {
  return request({
    url: '/carVulnerability/getDataValidation',
    method: 'get',
    params: query
  })
}
//道路设施易损性计算结果保存
export function saveCarResult(query) {
  return request({
    url: '/carVulnerability/crVulnerability',
    method: 'get',
    params: query
  })
}
//道路易损性计算
export function crVulnerability(data) {
  return request({
    url: '/carVulnerability/count',
    method: 'post',
    data: data
  })
}
//道路易损性结果保存
export function saveVulnerability2(data) {
  return request({
    url: '/valEngineering/updateByIdAndType',
    method: 'post',
    data: data
  })
}
//道路易损性计算过程查看
export function queryVulnerabilityResult(query) {
  return request({
    url: '/carVulnerability/getDataValidation',
    method: 'get',
    params: query
  })
}
//参数导入
export const importVulnerabilityUrl = '/carVulnerability/importVulnerability';
export function importVulnerabilityApi(data) {
  return request({
    url: importVulnerabilityUrl,
    method: 'post',
    data: data
  })
}

//通信
// 通信设施易损性验证
export function recalculateCe(query) {
  return request({
    url: '/ceVulnerability/getDataValidation',
    method: 'get',
    params: query
  })
}
//通信设施易损性计算结果保存
export function saveCeResult(query) {
  return request({
    url: '/ceVulnerability/caCeVulnerability',
    method: 'get',
    params: query
  })
}
//通信设备计算
export function caCeVulnerability(data) {
  return request({
    url: '/ceVulnerability/count',
    method: 'post',
    data: data
  })
}
//通信设备保存
export function saveCeVulnerability(data) {
  return request({
    url: '/valEngineering/updateByIdAndType',
    method: 'post',
    data: data
  })
}
//参数导入
export const importCeVulnerabilityUrl = '/ceVulnerability/importCeVulnerability';
export function importCeVulnerabilityApi(data) {
  return request({
    url: importCeVulnerabilityUrl,
    method: 'post',
    data: data
  })
}

//供电
//供电设备计算
export function caPseVulnerability(data) {
  return request({
    url: '/pseVulnerability/caPseVulnerability',
    method: 'post',
    data: data
  })
}
//供电设备保存
export function savePseVulnerability(data) {
  return request({
    url: '/pseVulnerability/savePseVulnerability',
    method: 'post',
    data: data
  })
}
//生成曲线
export function generateCurve(query) {
  return request({
    url: '/pseVulnerability/generateCurve',
    method: 'get',
    params: query
  })
}

//变电站
// 变电站设施易损性验证
export function recalculateCaTs(query) {
  return request({
    url: '/tsVulnerability/getDataValidation',
    method: 'get',
    params: query
  })
}
//变电站设施易损性计算结果保存
export function saveCaTsfResult(query) {
  return request({
    url: '/tsVulnerability/caTsVulnerability',
    method: 'get',
    params: query
  })
}
//变电站易损性计算
export function caTsVulnerability(data) {
  return request({
    url: '/tsVulnerability/count',
    method: 'post',
    data: data
  })
}
//变电站易损性保存
export function saveTsVulnerability(data) {
  return request({
    url: '/valEngineering/updateByIdAndType',
    method: 'post',
    data: data
  })
}
//排序
export function groupTsVulnerability(data) {
  return request({
    url: '/tsVulnerability/groupTsVulnerability',
    method: 'post',
    data: data
  })
}
//参数导入
export const importTsVulnerabilityUrl = '/tsVulnerability/importTsVulnerability';
export function importTsVulnerabilityApi(data) {
  return request({
    url: importTsVulnerabilityUrl,
    method: 'post',
    data: data
  })
}

//地下管网
//简单对应的模型保存
export function savePipelineDamageRate(data) {
  return request({
    url: '/valEngineering/updateByIdAndType',
    method: 'post',
    data: data
  })
}
//简单对应的模型计算
export function countPseVulnerability(data) {
  return request({
    url: '/upNetwork/countSimpleModel',
    method: 'post',
    data: data
  })
}
//参数导入
export const importPipelineDamageRateUrl = '/upNetwork/importPipelineDamageRate';
export function importPipelineDamageRateApi(data) {
  return request({
    url: importPipelineDamageRateUrl,
    method: 'post',
    data: data
  })
}

//新增接口式管道分析方法
export function saveInterfaceWelding(data) {
  return request({
    url: '/valEngineering/updateByIdAndType',
    method: 'post',
    data: data
  })
}
//接口式管道分析方法计算
export function countInterfaceWelding(data) {
  return request({
    url: '/upNetwork/interfaceCount',
    method: 'post',
    data: data
  })
}
//参数导入
export const importInterfaceWeldingUrl = '/upNetwork/importInterfaceWelding';
export function importInterfaceWeldingApi(data) {
  return request({
    url: importInterfaceWeldingUrl,
    method: 'post',
    data: data
  })
}

//新增连续焊接管道分析
export function saveContinuousWelding(data) {
  return request({
    url: '/valEngineering/updateByIdAndType',
    method: 'post',
    data: data
  })
}
//连续焊接管道分析计算
export function countContinuousWelding(data) {
  return request({
    url: '/upNetwork/continuousCount',
    method: 'post',
    data: data
  })
}
//参数导入
export const importContinuousWeldingUrl = '/upNetwork/importContinuousWelding';
export function importContinuousWeldingApi(data) {
  return request({
    url: importContinuousWeldingUrl,
    method: 'post',
    data: data
  })
}
